package com.zhc.dejingapi.pojo.qingflow.appfield;

import lombok.Data;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.ArrayList;
import java.util.List;

@Data
public class QingFieldDataItemWithDetailBase {

    //@TableId(value = "field_Id", type = IdType.AUTO)
    private Long fieldId;

    //@TableField("appMain_Id")
    private Long appmainId;

    //@TableField("appKey")
    private String appKey;

    //@TableField("associatedQueType")
    private String associatedQueType;

    //@TableField("auditValueDescription")
    private String auditValueDescription;

    //@TableField("beingCanDecrypted")
    private String beingCanDecrypted;

    //@TableField("beingDesensitized")
    private String beingDesensitized;

    //@TableField("dateType")
    private String dateType;

    //@TableField("queId")
    private Long queId;

    //@TableField("queTitle")
    private String queTitle;

    //@TableField("queType")
    private Integer queType;

    //@TableField("questionOrdinal")
    private String questionOrdinal;

    //@TableField("supId")
    private String supId;

    //@TableField("value_dataValue")
    private String valueDatavalue;

    //@TableField("value_email")
    private String valueEmail;

    //@TableField("value_id")
    private Long valueId;

    //@TableField("value_optionId")
    private String valueOptionid;

    //@TableField("value_ordinal")
    private String valueOrdinal;

    //@TableField("value_otherInfo")
    private String valueOtherinfo;

    //@TableField("value_pluginValue")
    private String valuePluginvalue;

    //@TableField("value_queId")
    private Long valueQueid;

    //@TableField("value_value")
    private String valueValue;

    private List<QingFieldDataItemTableRowValueWithDetailBase> tableRowFields;

    public  void LoadDetailRowField(JdbcTemplate mySqlJdbcTemplate){
        tableRowFields=new ArrayList<>();
        String strSql="";
        strSql="select * from qing_appfieldtablevalues where field_Id="+fieldId+" and  queId>1000000";
        //tableRowFields=mySqlJdbcTemplate.queryForList(strSql,QingFieldDataItemTableRowValueWithDetailBase.class);

        tableRowFields = mySqlJdbcTemplate.query(strSql, new BeanPropertyRowMapper<QingFieldDataItemTableRowValueWithDetailBase>(QingFieldDataItemTableRowValueWithDetailBase.class));


    }
}
